package wave.common.exception;

import wave.common.pojo.enums.RStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author 夕下风波
 * @date 2024-12-03 23:27
 * @description
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class WaveBusinessException extends RuntimeException {

    // 错误信息
    private String message;
    // 错误码
    private Integer code;

    public WaveBusinessException(String message) {
        this.message = message;
    }

    public WaveBusinessException(RStatusEnum status) {
        this.message = status.getText();
        this.code = status.getCode();
    }

    public WaveBusinessException(RStatusEnum status, String message) {
        this.message = message;
        this.code = status.getCode();
    }

}
